<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Keylist extends Model
{
    protected $table = 'key_list';
    protected $primaryKey = 'id';

    public static function keyListDetial($key)
    {
        return self::where("key",$key)->first();
    }

    public static function keyListActive($key,$users_id,$status)
    {
        return self::where("key",$key)->update(["users_id"=>$users_id,"status"=>$status]);
    }

    public static function articleInsert($title,$img,$type,$disable,$msg)
    {
        return self::insert(["title"=>$title,"img"=>$img,"type"=>$type,"disable"=>$disable,"msg"=>$msg,"created_at"=>time()]);
    }
}
